fix: 배너 컴포넌트 초기 렌더링 시 레이아웃 흔들림(화면 안정성 개선) #87
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#️⃣연관된 이슈
📝작업 내용
1. 배너 초기 렌더링 시 레이아웃 흔들림(CLS) 해결
문제 상황:
keen-slider 라이브러리는 자바스크립트가 실행되고 초기화(init)된 후에야 슬라이드 위치를 계산합니다. 이로 인해 JS 로딩 전(Hydration 이전)에는 contents들이 세로로 나열되었다가 제대로 확장 되며 레이아웃이 덜컥거리는 현상이 발생했습니다.
해결 방법:
JS가 로드되기 전에는 style를 활용하여 첫 번째 슬라이드만 노출하고, 나머지 슬라이드는 숨김(hidden) 처리하여 레이아웃을 고정했습니다.
스크린샷 (선택)
적용 전

적용 후
💬리뷰 요구사항(선택)
Summary by CodeRabbit
버그 수정
✏️ Tip: You can customize this high-level summary in your review settings.